<template>
  <div class="components-container">
    <!-- 编辑 -->
    <sweet-modal ref="dialog" class="dialog" :sweetModalMaxWidth="pageWidth">
        <h3>{{title}}</h3>
        <el-table :data="diechdData" border fit max-height="500" style="width:90%;margin:inherit;">
            <el-table-column property="YHSDESC" label="操作描述" align="center"></el-table-column>
            <!-- <el-table-column property="YHSSTATUS" label="操作状态" align="center"></el-table-column> -->
            <el-table-column property="YHSSIGNDESC" label="进退标记" align="center"></el-table-column>
            <el-table-column property="YHSUSR" label="操作人员" align="center"></el-table-column>
            <el-table-column property="YHSCOMPANY" label="操作单位" align="center"></el-table-column>
            <el-table-column property="YHSDATE" label="操作日期" align="center"></el-table-column>
        </el-table>
        <div class="layui-form-item btnCenter">
            <el-button type="" @click="closeDialog">关闭</el-button>
        </div>
    </sweet-modal>
  </div>
  </template>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/common.scss";
// .dialog table{
//     margin: 0px!important;
// }
// .dialog .el-table th.gutter{
//     display: table-cell!important;
// }
.dialog table{
    margin: inherit!important;
}
</style>

<script>
import apiBase from "@/api/apiBase.js";
import axios from 'axios'
import {formatDate,timeStringToDate,dateStringToDate} from "@/utils/date.js";
import sweetModal from "@/components/sweetModal";
import { ORDER } from "@/const/orderConst.js";
import header from '@/api/header.js'
import {
  MessageBox,
  Message
} from 'element-ui';

export default {
  name: "selectFileUpload",
  data() {
    return {
      pageWidth: 1000,
      maxHeight: 570,
      title: null,
      diechdData: [],
    };
  },
  methods: {
      //获取操作历史
    gethistory(id){
        let data = {
            Data: {YHSMBDID: id}
        };
        apiBase.DoService(data,apiBase.getApiAdress().History.Query,res => {
            console.log(res);
            this.diechdData = res.data.content.OutData;
            // this.diechdData = res.data.content.OutData;
            // for(let index in this.diechdData){
            //   this.diechdData[index].YHSDESC  = this.diechdData[index].YHSDESC;
            //   this.diechdData[index].YHSSTATUS = this.diechdData[index].YHSSTATUS;
            //   this.diechdData[index].YHSSIGNDESC = this.diechdData[index].YHSSIGNDESC;
            //   this.diechdData[index].YHSUSR = this.diechdData[index].YHSUSR;
            //   this.diechdData[index].YHSCOMPANY = this.diechdData[index].YHSCOMPANY;
            //   this.diechdData[index].YHSDATE = this.diechdData[index].YHSDATE;
            // }
        });
    },
    //打开页面
    open(order, id) {
        this.order = order;
        switch (this.order) {
            case "操作历史":
                this.title = '操作历史';
                this.gethistory(id);
                this.$refs.dialog.open();
            break;
            default:
        }
    },
    //取消按钮
    closeDialog() {
        this.$refs.dialog.close();
    },
  },
  components: {
    sweetModal,
  },
  mounted() {//在模板渲染成html后调用，通常是初始化页面完成后，再对html的dom节点进行一些需要的操作。
   
  },
  created() {//在模板渲染成html前调用，即通常初始化某些属性值，然后再渲染成视图。
 
  },
 
};
</script>
